@import "_settings"
$header-height = 40px

red-dot-before(leftPos = -8px)
  content: ""
  width: 0
  height: 0
  border 2px solid $red
  border-radius 50%
  position: absolute
  top: calc(50% - 1px)
  left: leftPos

#header
  background-color: #fff
  padding: $heading-padding-vertical 30px $heading-padding-vertical 60px
  position: relative
  z-index: $z-header
  display: flex
  justify-content: space-between
  box-sizing: border-box

#v3-banner
  background-color: #ffb731
  min-height: 40px
  padding: $heading-padding-vertical 60px
  z-index: $z-header - 1
  box-sizing: border-box
  text-align: center
  color: #333
  display: block
  // display: none

  a
    color: #34495e
    font-weight: bold
  .only-sm
    display: none
    margin: 0 5px

  @media screen and (max-width: 900px)
    .hidden-sm
      display: none
    .only-sm
      display: inline

body.docs
  #header
    position: fixed
    width: 100%
    top: 40px
  #v3-banner
    position: fixed
    width: 100%
    top: 0

#nav
  list-style-type: none
  margin: 0
  padding: 0
  line-height: $header-height
  .break
    display: none
  li
    display: inline-block
    position: relative
    margin: 0 .6em

  .nav-dropdown-container
    padding-right: .8em
    &:last-child
      padding-right: 0

  .nav-dropdown
    .nav-link
      &:hover, &.current
        border-bottom: none
      &.current
        &::after
          content: ""
          width: 0
          height: 0
          border-left: 5px solid $green
          border-top: 3px solid transparent
          border-bottom: 3px solid transparent
          position: absolute
          top: 50%
          transform: translateY(-50%)
          left: 8px
      &.new::before
        red-dot-before(8px)
  a.badge-parent
    padding-right 26px
    position relative
  sup.badge
    position absolute
    top -4px
    margin-left 4px
    background-color $green
    color #fff
    height 14px
    font-size 10px
    line-height 1
    font-weight bold
    border-radius 4px
    padding 3px 4px 0

.nav-link
  padding-bottom: 3px
  white-space: nowrap
  &:hover, &.current
    border-bottom: 3px solid $green
  &.new::before
    red-dot-before()

.new-label
  position: absolute
  top: 3px
  left: 110%
  background-color: $green
  color: #fff
  line-height: 16px
  height: 16px
  font-size: 9px
  font-weight: bold
  font-family: $code-font
  padding: 1px 4px 0 6px
  border-radius: 4px

.search-query
  height: 30px
  line-height: 30px
  box-sizing: border-box
  padding: 0 15px 0 30px
  border: 1px solid #e3e3e3
  color: $dark
  outline: none
  border-radius: 15px
  margin-right: 10px
  transition: border-color .2s ease
  background: #fff url(../images/search.png) 8px 5px no-repeat
  background-size: 20px
  vertical-align: middle !important
  &:focus
    border-color: $green

#logo
  display: inline-block
  font-size: 1.5em
  line-height: $header-height
  color: $dark
  font-family: $logo-font
  font-weight: 500
  img
    vertical-align: middle
    margin-right: 6px
    width: $header-height
    height: $header-height

#mobile-bar
  position: fixed
  top: 0
  left: 0
  width: 100%
  height: 40px
  background-color: #fff
  z-index: $z-header
  display: none
  box-shadow: 0 0 2px rgba(0,0,0,.25)
  pointer-events: none
  transition: background-color 0.25s ease-in
  > *
    pointer-events: auto
  .menu-button
    position: absolute
    width: 24px
    height: 24px
    top: 8px
    left: 12px
    background: url(../images/menu.png) center center no-repeat
    background-size: 24px
  .logo
    position: absolute
    width: 30px
    height: 30px
    background: url(../images/logo.svg) center center no-repeat
    top: 5px
    left: 50%
    margin-left: -15px
    background-size: 30px

@media print
  #header
    display: none
